压力位置曲线¶

  1. 观察整体实验过程。
  2. 按照伺服速度切分实验,绘制压力相对于光栅位置的曲线。
  3. 比较各个实验的压力——光栅位置曲线
In [1]:
# 整体查看数据状况
# 1. 实时数据有没有对应的配方数据
# 2. 实验数据是否完整,不完整的实验在自动切分的时候,会出现半个实验的报错
# 3. 切除不在查看目标内的数据,提高数据处理速度和提升观察效率
# 4. 确定是否要对照多个实验,以及需要对照的数据项和绘图x轴

# 并切分出易于处理,且包含实验数据的时间段,结果存入data,给后续步骤
from datavis import *

show            = True
filename        = "0106加热合模实验_实时1.csv"
is_time_slicing = True #第一次运行设为 False 查看整体。挑选并改写好起止时间之后设为 True。
start_time      = '2023/01/06 20:41:20:0000'
close_time      = '2023/01/06 21:03:06:0000'
legend          = '0106加热合模实验'
pretty          = False
is_debugging    = False #第一次运行设为 True 查看提示信息。没问题的,第二次以后设为 False。

data = datavis(filename = filename,
            is_time_slicing = is_time_slicing,
            start_time = start_time,
            close_time = close_time,
            show = show,
            pretty = pretty,
            is_debugging = is_debugging)
C:\Users\quxia\Documents\华彤实验记录\20230107佳乐绘图\datavis.py:86: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df['腔室盖'][df['腔室盖']=='上升']   = 10
C:\Users\quxia\Documents\华彤实验记录\20230107佳乐绘图\datavis.py:87: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df['腔室盖'][df['腔室盖']=='运行中'] = 10
C:\Users\quxia\Documents\华彤实验记录\20230107佳乐绘图\datavis.py:88: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df['腔室盖'][df['腔室盖']=='下降']   = 0
In [2]:
# 按照光栅位置提升过程,切分实验
# 1. 切分出在光栅位置超过 Heat 位置 - 0.1 mm 的数据段
#    光栅位置上升与heat位置设置,有一定偏差,不能完全按照 heat 位置切分。
#    模压过程,从heat位置上升到work位置,之后再次下降到host位置,但下降到低于heat位置,就不太重要了。
#    使用同一个标准(Heat 位置 - 0.1 mm)确定起止,相对简洁
# 2. 观察这一阶段的压力与光栅位置的关系,寻找压力提升的拐点
# 绘制压力——光栅位置曲线
margin = 0.1
heat_pos = data['HEAT位置'].iloc[0]
work_pos = data['WORK位置'].iloc[0]
vline = [heat_pos, work_pos]
pressure_bound = data['压力上限'].iloc[0]
annotations = {heat_pos:'HEAT位置 %2.4f mm' % (heat_pos), work_pos:'WORK位置 %2.4f mm' % (work_pos)}
low_bound = heat_pos - margin
extracted_data = data[data['光栅位置mm']>low_bound]
extracted_data = extracted_data[['光栅位置mm',
                                '压力kg']]
import cufflinks as cf
cf.set_config_file(offline=True)
extracted_data.iplot(kind='scatter',
           mode='lines+markers',
           size=2.5,
           theme='solar',
           x='光栅位置mm',
           y='压力kg',
           annotations=annotations,
           vline = vline,
           hline = pressure_bound,
           xTitle='光栅位置mm',
           yTitle='压力kg',
           title='压力位置曲线')
In [ ]:
from datavis import *

show            = True
filename        = "0107加热合模实验_实时1.csv"
is_time_slicing = False
start_time      = '2022/12/14 10:00:10:0000'
close_time      = '2022/12/14 22:05:29:8424'
legend          = '0107加热合模实验'
pretty          = False
is_debugging    = False

data = datavis(filename = filename,
            is_time_slicing = is_time_slicing,
            start_time = start_time,
            close_time = close_time,
            show = show,
            pretty = pretty,
            is_debugging = is_debugging)
In [ ]:
margin = 0.1
heat_pos = data['HEAT位置'].iloc[0]
work_pos = data['WORK位置'].iloc[0]
vline = [heat_pos, work_pos]
pressure_bound = data['压力上限'].iloc[0]
annotations = {heat_pos:'HEAT位置 %2.4f mm' % (heat_pos), work_pos:'WORK位置 %2.4f mm' % (work_pos)}
low_bound = heat_pos - margin
extracted_data = data[data['光栅位置mm']>low_bound]
extracted_data = extracted_data[['光栅位置mm',
                                '压力kg']]
import cufflinks as cf
cf.set_config_file(offline=True)
extracted_data.iplot(kind='scatter',
           mode='lines+markers',
           size=2.5,
           theme='solar',
           x='光栅位置mm',
           y='压力kg',
           annotations=annotations,
           vline = vline,
           hline = pressure_bound,
           xTitle='光栅位置mm',
           yTitle='压力kg',
           title='压力位置曲线')